//
//  ViewController.m
//  GNAPP
//
//  Created by zzp on 2019/1/8.
//  Copyright © 2019年 zzp. All rights reserved.
//

#import "ViewController.h"
#import <MAMapKit/MAMapKit.h>
#import "AnnotationViewController.h"
#import "OriginalMapViewController.h"
#import "MultiPointOverlayViewController.h"
#import "TransViaOriginalViewController.h"
#import <AMapFoundationKit/AMapFoundationKit.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSArray *titles=@[@"查看第三方高德地图",@"查看自带地图",@"高德MultiPointOverlay"];
    for (int d=0; d<titles.count; d++) {
        UIButton *bt=[[UIButton alloc]initWithFrame:CGRectMake(30, d*60 +90, 180,  50 )];
        [bt setTitle:titles[d] forState:UIControlStateNormal];
        [bt setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self.view addSubview:bt];
        bt.backgroundColor=[UIColor lightGrayColor];
        [bt addTarget:self action:@selector(gotoannoattion:) forControlEvents:UIControlEventTouchUpInside];
    }
  
    
//    [AMapServices sharedServices].enableHTTPS = YES;
//
//    ///初始化地图
//    MAMapView *_mapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
//
//    ///把地图添加至view
//    [self.view addSubview:_mapView];
    // Do any additional setup after loading the view, typically from a nib.
}

-(void)gotoannoattion:(UIButton*)bt{
    UIViewController *an;
        if([[bt titleForState:UIControlStateNormal] isEqualToString:@"查看第三方高德地图"]){
             an=[[AnnotationViewController alloc]init];
        }else if([[bt titleForState:UIControlStateNormal] isEqualToString:@"查看自带地图"]){
            
//            an=[[TransViaOriginalViewController alloc]init];
            an=[[OriginalMapViewController alloc]init];
        }else if([[bt titleForState:UIControlStateNormal] isEqualToString:@"高德MultiPointOverlay"]){
            an=[[MultiPointOverlayViewController alloc]init];
    
        }
   
    [self.navigationController pushViewController:an animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
